package main

import "fmt"

func main() {
	//sayLove2Golang()
	//sayLoveToSb("拉芳")
	//sayLoveToSb2("拉芳",5)
	//sayLoveToThem("拉芳","拉草","拉潘婷")
	sayLoveToSb3("拉芳","拉草",5)
}

func sayLove2Golang() {
	fmt.Println("人生苦短，必须性感")
	fmt.Println("此时不浪，更待何时")
	fmt.Println("师姐你在干嘛~")
	fmt.Println("让我们一起去浪吧~")
}

func sayLoveToSb(name string) {
	fmt.Println("人生苦短，必须性感")
	fmt.Printf("我爱%s\n", name)
}

func sayLoveToSb2(name string, n int) {
	fmt.Println("人生苦短，必须性感")
	for i := 0; i < n; i++ {
		fmt.Printf("我爱%s\n", name)
	}
}

func sayLoveToSb3(name1,name2 string, n int) {
	fmt.Println("人生苦短，必须性感")
	for i := 0; i < n; i++ {
		fmt.Printf("我爱%s\n", name1)
		fmt.Printf("我爱%s\n", name2)
	}
}

/*不定长参数：类型为切片容器*/
func sayLoveToThem(names ...string)  {
	fmt.Println("人生苦短，必须性感")
	//fmt.Println("我爱", names)
	for i,name := range(names){
		fmt.Printf("我爱No.%d：%s\n", i,name)
	}
}


